package com.guys8.cemsbackend.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guys8.cemsbackend.entity.Account;
import com.guys8.cemsbackend.entity.Class;
import com.guys8.cemsbackend.mapper.AccountMapper;
import com.guys8.cemsbackend.mapper.ClassMapper;
import com.guys8.cemsbackend.service.AccountService;
import com.guys8.cemsbackend.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (Account)表服务实现类
 *
 * @author breeze
 * @since 2022-08-24 16:53:21
 */
@Service("accountService")
public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> implements AccountService {

    public Account getbyschoolid(String schoolid){
        Map<String,Object> accountMap = new HashMap<>();
        accountMap.put("school_id", schoolid);
        List<Account> accounts = this.listByMap(accountMap);
        if(accounts.size()<1)
            return null;
        Account account = accounts.get(0);
        return account;
    }
}

